/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.ndx.majick.properties.impl;

import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeSupport;

import org.ndx.majick.properties.ComparableVetoableProperty;

/**
 *
 * @author Maison
 */
public class DefaultComparableVetoableProperty<Type extends Comparable<Type>> extends DefaultVetoableProperty<Type> implements ComparableVetoableProperty<Type> {
    public DefaultComparableVetoableProperty(Class<? extends Type> type, String name, PropertyChangeSupport support, VetoableChangeSupport vetoSupport) {
        super(type, name, support, vetoSupport);
    }
    
    public DefaultComparableVetoableProperty(Class<? extends Type> type, String name, PropertyChangeSupport support, VetoableChangeSupport vetoSupport, Type value) {
        this(type, name, support, vetoSupport);
        set(value);
    }

    public int compareTo(ComparableVetoableProperty<Type> o) {
        return get().compareTo(o.get());
    }

}
